package com.ruoyi.banner.service.impl;

import com.ruoyi.banner.domain.Banner;
import com.ruoyi.banner.mapper.BannerMapper;
import com.ruoyi.banner.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BannerServiceImpl implements BannerService {

        @Autowired
        private BannerMapper mapper;
        @Override
        //service是接口板，并没有真的实现方法

        public List<Banner> getBannerList() {
            return mapper.queryAll();
        }

        @Override
        public int addBanner(Banner banner) {
            return mapper.addBanner(banner);
        }

        @Override
        public List<Banner> queryBannerByTitle(String title) {
            return mapper.queryBannerByTitle(title);
        }

        @Override
        public void updateBanner(Banner banner) {
            mapper.updateBanner(banner);
        }


    @Override
    public void deleteBanner(int id) {
        mapper.deleteBanner(id);
    }
}

